package engine.audio;

/**
 * AudioBuffer_I
 * Interface for a class containing raw audio data.
 **/
public interface AudioBuffer_I {
	/**
	 * @return - The size, in bytes, of this buffer.
	 **/
	int getSize();
	/**
	 * @return - The number of free bytes in this buffer.
	 **/
	int getFree();
	/**
	 * Clears this buffer out.
	 * This is guaranteed to reset all buffer pointers used in fill and drain
	 * operations, but is not guaranteed to zero out the buffer.
	 **/
	void clear();
	/**
	 * Fills this buffer with length bytes of inBuffer. Further uses o fill will
	 * append data to this buffer unless it is full.
	 * @param inBuffer - the source data buffer to copy from.
	 * @param length - the number of bytes to copy.
	 * @return - the number of bytes copied.
	 **/
	int fill(byte[] inBuffer, int length);
	/**
	 * Drains length bytes of this buffer into outBuffer. Bytes are drained in
	 * the order they were received, making this a FIFO data structure.
	 * @param outBuffer - the destination data buffer to copy to.
	 * @param length - the number of bytes to copy.
	 * @return - the number of bytes copied.
	 **/
	int drain(byte[] outBuffer, int length);
	/**
	 * @return - A reference to the underlying data array.
	 **/
	byte[] getData();
}